<?php

/**
 * Returns zodiac for given date
 *
 * @package Rapide_View
 *
 */
class Rapide_View_Helper_Zodiac extends Rapide_View_Helper
{
  public function execute($sDate)
  {
    $iDateMonth = (int)date('n', strtotime($sDate));
    $iDateDay   = (int)date('j', strtotime($sDate));

    $sZodiac = null;

    if(($iDateMonth == 3 && $iDateDay >= 23) || ($iDateMonth == 4 && $iDateDay <= 20))
      $sZodiac = 'Aries';

    if(($iDateMonth == 4 && $iDateDay >= 21) || ($iDateMonth == 5 && $iDateDay <= 21))
      $sZodiac = 'Taurus';

    if(($iDateMonth == 5 && $iDateDay >= 22) || ($iDateMonth == 6 && $iDateDay <= 21))
      $sZodiac = 'Gemini';

    if(($iDateMonth == 6 && $iDateDay >= 22) || ($iDateMonth == 7 && $iDateDay <= 22))
      $sZodiac = 'Cancer';

    if(($iDateMonth == 7 && $iDateDay >= 23) || ($iDateMonth == 8 && $iDateDay <= 22))
      $sZodiac = 'Leo';

    if(($iDateMonth == 8 && $iDateDay >= 23) || ($iDateMonth == 9 && $iDateDay <= 22))
      $sZodiac = 'Virgo';

    if(($iDateMonth == 9 && $iDateDay >= 23) || ($iDateMonth == 10 && $iDateDay <= 22))
      $sZodiac = 'Libra';

    if(($iDateMonth == 10 && $iDateDay >= 23) || ($iDateMonth == 11 && $iDateDay <= 21))
      $sZodiac = 'Scorpio';

    if(($iDateMonth == 11 && $iDateDay >= 22) || ($iDateMonth == 12 && $iDateDay <= 21))
      $sZodiac = 'Sagittarius';

    if(($iDateMonth == 12 && $iDateDay >= 22) || ($iDateMonth == 1 && $iDateDay <= 20))
      $sZodiac = 'Capricorn';

    if(($iDateMonth == 1 && $iDateDay >= 21) || ($iDateMonth == 2 && $iDateDay <= 19))
      $sZodiac = 'Aquarius';

    if(($iDateMonth == 2 && $iDateDay >= 20) || ($iDateMonth == 3 && $iDateDay <= 22))
      $sZodiac = 'Pisces';

    return $this->getView()->lang('Date', 'Zodiac', $sZodiac);
  }
}

?>